<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>upload</title>
	<script type="text/javascript" charset="utf-8" src="${base}/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="${base}/ueditor/ueditor.all.js"> </script>
	<script type="text/javascript" charset="utf-8" src="${base}/ueditor/lang/zh-cn/zh-cn.js"></script>
	  <script>
        var HtmlUtil = {
            /*2.用正则表达式实现html解码*/
            htmlEncodeByRegExp:function (str){
                var s = "";
                if(str.length == 0) { 
                	return "";  
                }
                s = str.replace(/&amp;/g,"&"); 
                s = s.replace(/&lt;/g,"<"); 
                s = s.replace(/&gt;/g,">"); 
                s = s.replace(/&nbsp;/g," "); 
                s = s.replace(/&#39;/g,"\'"); 
                s = s.replace(/&quot;/g,"\""); 
                return s; 
           }
        };
    </script>
</head>
<body>
<form method="post"  onsubmit="return verifyProductForm();" action="${base}/user/ueditSave">
<script id="editor" type="text/plain" style="width:100%;height:400px;max-width: 700px;"></script>
<input name="content"  id="content"   type="hidden"/>

<p>
<input  type="submit"  value="保存"/>
</p>
</form>
<script src="${base}/js/jquery1.10.2.min.js" ></script>
<script>
window.onload = function(){
    setTimeout('init()',500);
}
var ue = UE.getEditor('editor');

function init(){
    ue.execCommand('insertHtml',HtmlUtil.htmlEncodeByRegExp('${content?if_exists}"'));
}

function getContent() {
    return UE.getEditor('editor').getContent();
}
function verifyProductForm(){
    $("#content").val('');
    $("#content").val(getContent());
    return true;
}
</script>
</body>
</html>
